
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>My Chat Room </title>
<link href="style.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="js/scroll_var.js"></script>
<script type="text/javascript" src="js/function.js"></script>
<script type="text/javascript">

       //reset sessioin variable if refresh
        synchronous_ajax("sessionservlet","param=reload");  
             
        var lastScrollTop=0;
        
        function OnScrollDiv (div) 
        {
           
           var st = div.scrollTop;
           
           if ( st < lastScrollTop) 
               scrolling = true;
           else
               scrolling = false;
               
           lastScrollTop  = st;
        }
        
        window.onbeforeunload = function () 
        {
                //window.alert(' before unload');            
                 //synchronous_ajax("sessionservlet","param=leavepage");           
                 
        };
        
       
             
</script>
    
</head>

<body>
<div id="wrapper">
	<div id="nav"> 
    	<div id="nav_link">
        	<b> Group Chat vui vẻ </b>
        </div>
        <div id="welcome">
            <script> 
        	   var current_user = synchronous_ajax("sessionservlet","param=getuser");
        	   //window.alert(current_user);  
        	   if(current_user!="")
        		   {
			  			document.write("Chào mừng <b>"+  current_user +  "</b> <a href=\"javascript:logout_func()\">Thoát</a>");
			       }
        	   else
        		   {
        		      window.location="login.html";
        		   }
			</script>
        </div>
    </div><!--/#nav-->
    <div id="main"  onscroll="OnScrollDiv(this)">
   		<div id="content">
        	
    	</div><!--/#content-->
    </div><!--/#main-->
    
    <div id="userlist">
   		Loading...
    </div><!--/#userlist-->
     
    <div id="shoutform">
   		<form name="chatform"  action="javascript:check_form();">
        <div id="upstyle">
            <input id="upb" onclick="upstyle('b')" type="button" class="sbutton" style="font-weight:bold" value="B" />
            <input id="upi" onclick="upstyle('i')" type="button" class="sbutton" style="font-style:italic" value="I" />
            <input id="upu" onclick="upstyle('u')" type="button" class="sbutton" style="text-transform:uppercase" value="U" />
            <select id="upfont">
                <option value="">Default</option>
                <option value="Arial" style="font-family:Arial">Arial</option>
                <option value="Arial Black" style="font-family:Arial Black">Arial Black</option>
                <option value="Book Antiqua" style="font-family:Book Antiqua">Book Antiqua</option>
                <option value="Century Gothic" style="font-family:Century Gothic">Century Gothic</option>
                <option value="Comic Sans MS" style="font-family:Comic Sans MS">Comic Sans MS</option>
                <option value="Courier New" style="font-family:Courier New">Courier New</option>
                <option value="Impact" style="font-family:Impact">Impact</option>
                <option value="Tahoma" style="font-family:Tahoma">Tahoma</option>
                <option value="Times New Roman" style="font-family:Times New Roman">Times New Roman</option>
                <option value="Trebuchet MS" style="font-family:Trebuchet MS">Trebuchet MS</option>
                <option value="Verdana" style="font-family:Verdana">Verdana</option>
            </select>
            <select id="upcolor">
                <option value="">Default</option>
                <option style="background: Gold;" value="Gold">Gold</option>
                <option style="background: Khaki;" value="Khaki">Khaki</option>
                <option style="background: Orange;" value="Orange">Orange</option>
                <option style="background: LightPink;" value="LightPink">LightPink</option>
                <option style="background: Salmon;" value="Salmon">Salmon</option>
                <option style="background: Tomato;" value="Tomato">Tomato</option>
                <option style="background: Red;" value="Red">Red</option>
                <option style="background: Brown;" value="Brown">Brown</option>
                <option style="background: Maroon;" value="Maroon">Maroon</option>
                <option style="background: DarkGreen;" value="DarkGreen">DarkGreen</option>
                <option style="background: DarkCyan;" value="DarkCyan">DarkCyan</option>
                <option style="background: LightSeaGreen;" value="LightSeaGreen">LightSeaGreen</option>
                <option style="background: LawnGreen;" value="LawnGreen">LawnGreen</option>
                <option style="background: MediumSeaGreen;" value="MediumSeaGreen">MediumSeaGreen</option>
                <option style="background: BlueViolet;" value="BlueViolet">BlueViolet</option>
                <option style="background: Cyan;" value="Cyan">Cyan</option>
                <option style="background: Blue;" value="Blue">Blue</option>
                <option style="background: DodgerBlue;" value="DodgerBlue">DodgerBlue</option>
                <option style="background: LightSkyBlue;" value="LightSkyBlue">LightSkyBlue</option>
                <option style="background: White;" value="White">White</option>
                <option style="background: DimGray;" value="DimGray">DimGray</option>
                <option style="background: DarkGray;" value="DarkGray">DarkGray</option>
                <option style="background: Black;" value="Black">Black</option>
            </select>
            <input type="button" class="sbutton" value="Smilies" onclick="smiliepopup();" />
        </div> <!--/#upstyle-->
        <div id="upwrite">
        	<div style="float:left"><input maxlength="255" type="text" id="uptext"/></div>
            <div style="float:right"><input type="submit" id="submitform"  value="Send" /></div>
        </div><!--/#upwrite-->
        </form>
    </div><!--/#shoutform-->
</div><!--/#wrapper-->
<script>
_load('content');
_load('online');
_refresh('content');
_refresh('online');
</script>
</body>
</html>